unit uCon_IntervaloDesc;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Formulario_Padrao_Consulta, Provider, DBClient, DB, DBTables,
  Grids, DBGrids, TFlatButtonUnit, StdCtrls, Buttons, ExtCtrls;

type
  TfrmCon_IntervaloDesc = class(TFrmConsulta)
    DBGrid1: TDBGrid;
    DS: TDataSource;
    tq: TQuery;
    CDS: TClientDataSet;
    DataSetProvider1: TDataSetProvider;
    CDSIND_INTERVALOINI: TFloatField;
    CDSIND_INTERVALOFIM: TFloatField;
    CDSIND_PERCDESCONTO: TFloatField;
    procedure BtnFecharClick(Sender: TObject);
    procedure DBGrid1TitleClick(Column: TColumn);
    procedure FormActivate(Sender: TObject);
    procedure DBGrid1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    iIni,iFim: Double;
  end;

var
  frmCon_IntervaloDesc: TfrmCon_IntervaloDesc;

implementation

uses Dm;

{$R *.dfm}

procedure TfrmCon_IntervaloDesc.BtnFecharClick(Sender: TObject);
begin
  inherited;
 iIni:= CDS.FieldByName('IND_IntervaloIni').AsFloat;
 iFim:=CDS.FieldByName('IND_IntervaloFim').AsFloat;
end;

procedure TfrmCon_IntervaloDesc.DBGrid1TitleClick(Column: TColumn);
begin
  inherited;
 CDS.IndexFieldNames:= Column.FieldName;
end;

procedure TfrmCon_IntervaloDesc.FormActivate(Sender: TObject);
begin
  inherited;
 tq.Close;
 CDS.Close;
 tq.DatabaseName:= DmInt.Db.DatabaseName;
 CDS.Open;
 CDS.First;
 Panel2.Enabled:= True;
end;


procedure TfrmCon_IntervaloDesc.DBGrid1DblClick(Sender: TObject);
begin
  inherited;
 BtnFecharClick(sender);
end;

end.
